package com.greatwqs.wmall.message.consumer.service;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Service;

import com.greatwqs.wmall.message.consumer.config.KafkaTopicConfig;

@Service
public class KafkaConsumerService {

    @KafkaListener(topics = KafkaTopicConfig.TOPIC_NAME, groupId = "my-group")
    public void listen(String message) {
        System.out.println("Received Message in group 'my-group': " + message);
    }

    @KafkaListener(topics = KafkaTopicConfig.TOPIC_PARTITIONED_NAME, groupId = "my-group")
    public void listenPartitionedTopic(String message) {
        System.out.println("Received Message from partitioned topic: " + message);
    }
}